<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			
			var stu = {
				id:1,
				name:"张三",
				age:18
			}
			
			// 1. for ... in 对象
			for(var i in stu)
			{
				// i 对象的属性名
				document.write(i+","+stu[i]+"<br />");
			}
			
			// 2. with
			with(stu)
			{
				document.write(id+","+name+","+age);
			}
		</script>
	</body>
</html>